﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Crm2011EventBinder.Serialization
{
    public class Handler
    {
        public String functionName { get; set; }
        public String libraryName { get; set; }
        public String handlerUniqueId { get; set; }
        public Boolean enabled { get; set; }
        public String parameters { get; set; }
        public Boolean passExecutionContext { get; set; }

        public override string ToString()
        {
            return String.Format("<Handler functionName=\"{0}\" libraryName=\"{1}\" handlerUniqueId=\"{2}\" enabled=\"{3}\" parameters=\"{4}\" passExecutionContext=\"{5}\" />",
                                    functionName.Replace("\"", "&quot;"),
                                    libraryName.Replace("\"", "&quot;"),
                                    handlerUniqueId.Replace("\"", "&quot;"),
                                    enabled.ToString().ToLower(),
                                    parameters.Replace("\"", "&quot;"),
                                    passExecutionContext.ToString().ToLower());
        }

    }
}
